problem with loading a target object

Hey all,

I'm facing a problem with loading a target object. When executing this code:
 

Link lnk
for lnk in o -> "*" do {
                                                                                                        
        read(fullName target (lnk), false)
                                                                
        Object targetObject = target (lnk)
                                                                                                                                        
        tmp = targetObject."Required_Release_auto"
}

 


i get the following error:
-R-E- DXL: <Line:131> null Object parameter was passed into argument position 1
(Line:131 is "tmp = targetObject."Required_Release_auto"")

Target object isnt deleted and target module has the attribute "Required_Release_auto".
Any other ideas on this?

Regards,
Manuel

 


ManuelFelger - Mon Apr 12 07:40:02 EDT 2010

Re: problem with loading a target object
Mathias Mamsch - Mon Apr 12 08:14:43 EDT 2010

I suppose, you would have seen an access problem with the link module or the target module, if you had one. Another possibility would be a link to a baseline, where the read fullname ... would not work.

If you go to the problematic object and run the below code, what do you get?

Regards, Mathias
 

Link lnk
for lnk in (current Object) -> "*" do {
    string s = fullName target (lnk)
    read(s, false)
    print "Mod:" s "\n"
    print "AbsNo:" (targetAbsNo lnk) "\n"
    print "Version:" (versionString targetVersion lnk) "\n"
    Object targetObject = target (lnk)
    if (!null targetObject) {
        int tmp = targetObject."Absolute Number"
        print "AbsNo:" tmp "\n"
    } else { print "NULL" }
}

Re: problem with loading a target object
ManuelFelger - Mon Apr 12 08:36:21 EDT 2010

Mathias Mamsch - Mon Apr 12 08:14:43 EDT 2010

I suppose, you would have seen an access problem with the link module or the target module, if you had one. Another possibility would be a link to a baseline, where the read fullname ... would not work.

If you go to the problematic object and run the below code, what do you get?

Regards, Mathias
 

Link lnk
for lnk in (current Object) -> "*" do {
    string s = fullName target (lnk)
    read(s, false)
    print "Mod:" s "\n"
    print "AbsNo:" (targetAbsNo lnk) "\n"
    print "Version:" (versionString targetVersion lnk) "\n"
    Object targetObject = target (lnk)
    if (!null targetObject) {
        int tmp = targetObject."Absolute Number"
        print "AbsNo:" tmp "\n"
    } else { print "NULL" }
}

I found out what the problem was: i've had an error in an included lock-checking function that falsely closed the target module in some cases after opening it for read.. so the target object couldnt be loaded..

Anyway thanks for your quick reply Mathias!

Regards,
Manuel